package com.njbdqn.filter

import com.njbdqn.util.{HDFSConnection, MySQLConnection}
import org.apache.spark.sql.SparkSession

/**
  * 清洗不能推荐的商品 并把留下的商品存放到hdfs上
  */
object BanGoodFilter {
  def ban(spark:SparkSession)={
    //读出原始商品数据
    val goodDF = MySQLConnection.readMySQL(spark,"goods")
    //将商品中下架的商品去除//去除特色的商品分类//并将数据存放到hdfs
    val gd = goodDF.filter("is_sale=1")
    HDFSConnection.writeDataToHDFS("/myshops/dwd_good",gd)
  }
}
